// import React,{useReducer,useContext} from 'react'
// import ContextStyle from '../../App'
// export default function testUseReducer() {
//     const initialState:any = {count:0,age:2000,name:'1234'}
//     const [state,dispatch]:any = useReducer(reducer,initialState)
//     function reducer(state:any,action:any){
//         switch(action.type){
//             case 'up':
//                 return {count : state.count +1,age:state.age,name:state.name}
//             case 'down':
//                 return {count: state.count-1,age:state.age,name:state.name}
//             case 'changeName':
//                 return {count:state.count,age:state.age,name:'唔哈哈哈'}
//             case 'changeAge':
//                 return {count:state.count,age:'2022',name:state.name}
//             default:
//                 return {...state}
//         }
//     }
//     const Style = useContext(ContextStyle)
//   return (
//     <div style={Style}>
//         {state.count}-{state.age}-{state.name}
//         <button onClick={()=>dispatch({type:'up'})}>upupupup</button>
//         <button onClick={()=>dispatch({type:'down'})}>down</button>
//         <button onClick={()=>dispatch({type:'changeName'})}>changeName</button>
//         <button onClick={()=>dispatch({type:'changeAge'})}>changeAge</button>
//         <button onClick={()=>dispatch({type:''})}>refresh</button>
//     </div>
//   )
// }





import React,{useContext} from 'react'
import  AppContext from '../useContext/style'
export default function testUseReducer() {
    // const res = useContext(AppContext)
    // console.log(res)
  return (
      <AppContext.Consumer>
          {
              (a) => {
                //   console.log(a)
                  return (
                    <div>孙</div>
                  )
              }
          }
      </AppContext.Consumer>
  
  )
}

